package eval.vm;

import java.util.List;

/**
 * Interface for the main operations offered by the VM manager
 * 
 * @author Nicolo' M. Calcavecchia <calcavecchia@elet.polimi.it>
 */
public interface IVMManager {

	/**
	 * Returns the total number of known VMs
	 * */
	public int getNumberOfVMs();

	/**
	 * Returns the configuration for the given VM number
	 * */
	public VMConfiguration getVMConfiguration(VMIdentifier vmIdentifier);

	/**
	 * Returns the VMConfiguration of the given type
	 * */
	public VMConfiguration getVMConfigurationForEnum(
			VMConfigurationEnum configurationEnum);

	public void setSatisfiedLoad(VirtualMachine vm,int satisfiedCpu, int satisfiedMem);

//	/**
//	 * Returns the VMConfiguration for the given virtual machine
//	 * */
	public VMConfiguration getVMConfigurationForVM(VirtualMachine virtualMachine);

//	/**
//	 * Extracts a new VM according to the probabilistic distribution given in
//	 * the configuration file
//	 * */
//	public VMConfigurationEnum generateNewVmAccordingToDistribution();

//	/**
//	 * Prints all the VMs
//	 * */
//	public void printAllVms();

//	/**
//	 * Gets the virtual machine that has index <code>index</code> in the cplex
//	 * data source at the given tick
//	 * 
//	 * @param index
//	 *            of the vm in the CPLEX data source
//	 * @param tick
//	 * */
//	public VirtualMachine getVirtualMachineWithIndexAtTick(int index, int tick);

//	/**
//	 * Sets the virtual machine has having the given index at the given tick
//	 * 
//	 * @param virtualMachine
//	 *            the virtual machine we are setting the property
//	 * @param index
//	 *            index of this virtual machine in the CPLEX data source
//	 * @param tick
//	 *            tick where the property is set
//	 * 
//	 * */
//	public void setVirtualMachineIndexAtTick(VirtualMachine virtualMachine,
//			int index, int tick);

//	/**
//	 * Adds the list of known vms
//	 * */
	public void addKnownVMs(List<VirtualMachine> vMs);

//	/**
//	 * Adds the VM to the list of known VMs
//	 * */
	public void addKnownVM(VirtualMachine virtualMachine);

//	/**
//	 * Returns the index for a VM at the given tick
//	 * */
//	public int getVMIndexForVMAtTick(VirtualMachine vm, int tick);
//
//	/**
//	 * Returns the virtual Machine with the given index
//	 * */
//	public VirtualMachine getVirtualMachineWithId(int id);
//
	/***
	 * Returns all the instantiated virtual machines
	 **/
	public List<VirtualMachine> getAllVirtualMachines();

	public void removeListOfVMs(List<VirtualMachine> vmsToRemove);

	public VirtualMachine getVMbyID(VMIdentifier vmID);
	
	public VMIdentifier getVMbyID(int id);

}
